<extend name="Public/base"/>

<!-- 子导航 -->
<block name="sidebar">
    <include file="sidemenu" />
</block>
<!-- css样式 -->
<block name="body">
	<style type="text/css">
		#houtai{color: #404040;font-weight: bold;}
		.yunyin{float: right;line-height: 25px;font-size: 30px;}
		.liudehua{margin-right: 30px;}
		.xian{float: none;padding-top: 80px;}
		.f1{margin-left: 10px;}
		#f2{width: 228px;height: 32px;margin-left:-10px;}
		#f3{width: 228px;height: 32px;margin-left: 20px;}
		.f4{float: left;margin-right: 150px;margin-left:23px;width: 228px;height: 36px}
		.cangku{margin-top: 15px;}
		.cangku .btn{margin-top: 18px;float: left;margin-right:1px;}
		.data-table,td{border: 1px solid lightgrey;margin-top: 62px;}
		.xinzen{float: right;margin-top:3px;margin-left:-180px;}
	</style>
	<div class="main-title">
		<h2 id="houtai">管理后台</h2>
		<div class="yunyin"><span class="liudehua" style="font-size: 15px;">运营：刘德华</span><a  style="font-size: 15px;color:#445566 " href="/zhubajie/admin.php?s=/Public/logout.html" >退出</a></div>
	</div>
	<!-- 工具栏 -->
	<div class="product_headcut">
	<div class="f1">

		<!-- 高级搜索 -->
		<form class="search-form fr cf">
			<input id="f2" name='good_id' class="search-input" value="{:I('good_id')}" placeholder="商品ID">
			<input id="f3" type="text" name="sub_title" class="search-input" value="{:I('sub_title')}" placeholder="商品名称" >
			<select class=f4 name="good_type" >
				<option value="">选择商品类型</option>
				<option value="1">抢购商品</option>
				<option value="2">预约商品</option>
				<option value="3">定制商品</option>
			</select>
			<div class="xinzen">
				<a class="btn" href="admin.php?s=/Good/panicadd/file_type/1.html">新增</a>
				<a class="btn" id='search' url="admin.php?s=/Good/panicproduct.html">筛选</a>
			</div>
		</form>
	</div>
		<div class="xian">
			<hr>
		</div>
	<div class="cangku">
		<a class="btn" href="admin.php?s=/Good/panicadd/file_type/1.html">已上架</a>
	    <a class="btn" href="admin.php?s=/Good/panicadd/file_type/1.html">仓库</a>
	</div>

	<!-- 数据表格 -->
    <div class="data-table">
		<table>
            <!-- 表头 -->
            <thead>
                <tr>

					<th>商品ID</th>
					<th>商品名称</th>
					<th>售价</th>
					<th>库存</th>
					<th>销量</th>
					<th>商品类型</th>
					<th>更新时间</th>
					<th>操作</th>
                </tr>
            </thead>

            <!-- 列表 -->
            <tbody>
			<tbody>
			<notempty name="_list">
				<volist name="_list" id="vo">
					<tr>

						<td >{$vo.id}</td>
						<td ><img src="{$vo.img_path}" />{$vo.title}</td>
						<td >{$vo.discount_price}</td>
						<td >{$vo.stock}</td>
						<td >{$vo.investcount}</td>
						<td >{$vo.status}</td>
					    <td >{$vo['create_time']}</td>
						<td >

							<a href="{:U('Good/panicadd', array('id' => $vo['id'], 'file_type' => '1'))}">编辑</a>
							<a href="{:U('Good/deletegood', array('id' => $vo['id']))}" onclick="if(!confirm('确定删除商品?')){return false;}">刪除</a>
						</td>
					</tr>
				</volist>
				<else/>
				<td colspan="6" class="text-center"> aOh! 暂时还没有内容! </td>
			</notempty>
			</tbody>

        </table>
		<div class="page">
			{$_page}
		</div>
	</div>
	<!-- 分页 -->
    <div class="page">
        {$_page}
    </div>
 </div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript">
$(function() {
	//搜索功能
	$("#search").click(function () {
		var url = $(this).attr('url');
		var query = $('.search-form').serialize();
		query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
		query = query.replace(/^&/g, '');
		if (url.indexOf('?') > 0) {
			url += '&' + query;
		} else {
			url += '?' + query;
		}
		window.location.href = url;
	});
	//回车搜索
	$(".search-input").keyup(function (e) {
		if (e.keyCode === 13) {
			$("#search").click();
			return false;
		}
	});
	//导航高亮
	highlight_subnav('admin.php?s=/Good/panicproduct.html');
});
</script>
</block>
